package com.flame.user.mapper;

import java.util.List;

import com.flame.auth.core.annotation.DataFilter;
import com.flame.auth.core.constants.AuthConstants;
import com.flame.user.controller.vo.UserAccountVo;
import com.flame.user.controller.vo.UserInfoVo;
import com.flame.user.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * flame_user_info 用户信息表
 *
 * @author 吴欣童
 * @since 2022-12-14 17:20:40
 */
@Mapper
public interface UserInfoMapper {

    @DataFilter(dataType = AuthConstants.DATA_TYPE_USER, column = "a.user_id")
    @DataFilter(dataType = AuthConstants.DATA_TYPE_ORG, column = "a.org_code")
    List<UserAccountVo> page(UserInfoVo userInfoVo);

    void insert(UserInfo userInfo);

    void updateById(UserInfo userInfo);

    void deleteById(@Param("userId") String userId);

    UserInfo findById(@Param("userId") String userId);

    List<UserInfo> listByOrgCode(@Param("orgCode") String orgCode);
}